package com.wwh.aop.homework;

import org.springframework.stereotype.Component;

/**
 * @author Albert
 * @date 2024/8/27-13:11
 * @describe
 */
//@Component
public class MyCal implements Cal{
    @Override
    public int cal1(int n) {
        int sum = 0;
        for(int i = 1; i <= n; i++){
            sum += i;
        }
        System.out.println("cal1 res = " + sum);
        return sum;
    }

    @Override
    public int cal2(int n) {
        int res = 1;
        for(int i = 1; i <= n; i++){
            res *= i;
        }
        System.out.println("cal2 res = " + res);
        return res;
    }
}
